#include <stdio.h>
/**
 * 集合合并
 */

int isExist(int a[],int alen,int n){
    for (int i = 0; i < alen; i++)
    {
        if(a[i] == n){
            return 1;
        }
    }
    return 0;
}

int main(){
    int a[5] = {1,2,3};
    int b[] = {3,4,5};
    for (int i = 0; i < (sizeof(b)/sizeof(b[0])); i++)
    {
        int alen =sizeof(a)/sizeof(a[0]);
        if (isExist(a,alen,b[i]) <= 0){
            printf("+%d\n",b[i]);
            //a[(sizeofa(a)/sizeof(a[0])+1)] = b[i];
            a[b[i]-1] = b[i];
        }
    }
    for (int i = 0; i < (sizeof(a)/sizeof(a[0])); i++)
    {
        printf("%d,",a[i]);
    }
}

